﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ForeignLanguageSkillBL
	{

		#region ***** Init Methods ***** 
		ForeignLanguageSkillDA objForeignLanguageSkillDA;
		public ForeignLanguageSkillBL()
		{
			objForeignLanguageSkillDA = new ForeignLanguageSkillDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ForeignLanguageSkill by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ForeignLanguageSkill</returns>
        public ForeignLanguageSkill GetByID(int id, int PersonalProfileID)
		{
            return objForeignLanguageSkillDA.GetByID(id, PersonalProfileID);
		}

		/// <summary>
		/// Get all of ForeignLanguageSkill
		/// </summary>
		/// <returns>List<<ForeignLanguageSkill>></returns>
		public List<ForeignLanguageSkill> GetList()
		{
			string cacheName = "lstForeignLanguageSkill";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objForeignLanguageSkillDA.GetList(), "ForeignLanguageSkill");
			}
			return (List<ForeignLanguageSkill>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ForeignLanguageSkill
		/// </summary>
		/// <returns>DataSet</returns>
        public DataSet GetDataSet(int PersonalProfileID)
		{
			string cacheName = "dsForeignLanguageSkill";
            ServerCache.Remove("ForeignLanguageSkill");
			if( ServerCache.Get(cacheName) == null )
			{
                ServerCache.Insert(cacheName, objForeignLanguageSkillDA.GetDataSet(PersonalProfileID), "ForeignLanguageSkill");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}
     
		/// <summary>
		/// Get all of ForeignLanguageSkill paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ForeignLanguageSkill>></returns>
		public List<ForeignLanguageSkill> GetListPaged(int recperpage, int pageindex)
		{
			return objForeignLanguageSkillDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ForeignLanguageSkill paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objForeignLanguageSkillDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ForeignLanguageSkill within ForeignLanguageSkill database table
		/// </summary>
		/// <param name="obj_foreignlanguageskill">ForeignLanguageSkill</param>
		/// <returns>key of table</returns>
		public int Add(ForeignLanguageSkill obj_foreignlanguageskill)
		{
			ServerCache.Remove("ForeignLanguageSkill", true);
			return objForeignLanguageSkillDA.Add(obj_foreignlanguageskill);
		}

		/// <summary>
		/// updates the specified ForeignLanguageSkill
		/// </summary>
		/// <param name="obj_foreignlanguageskill">ForeignLanguageSkill</param>
		/// <returns></returns>
		public void Update(ForeignLanguageSkill obj_foreignlanguageskill)
		{
			ServerCache.Remove("ForeignLanguageSkill", true);
			objForeignLanguageSkillDA.Update(obj_foreignlanguageskill);
		}

		/// <summary>
		/// Delete the specified ForeignLanguageSkill
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ForeignLanguageSkill", true);
			objForeignLanguageSkillDA.Delete(id);
		}
		#endregion
	}
}
